package com.sinven.monitor;

import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;

import com.sinven.pojo.Classification;
import com.sinven.pojo.Content;
import com.sinven.serivce.ClassificationSerivce;
import com.sinven.serivce.ClassificationSerivceImpl;
import com.sinven.serivce.ContentSerivce;
import com.sinven.serivce.ContentSerivceImpl;

public class Jiantinqi  extends ContextLoaderListener{

	public ClassificationSerivce classificationserivce=new ClassificationSerivceImpl();
		
	public ContentSerivce contentSerivce = new ContentSerivceImpl();
	
	public Jiantinqi() {
	}
	
	public Jiantinqi(WebApplicationContext context) {
		super(context);
	}
	
	

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		/*
		 * initWebApplicationContext(sce.getServletContext()); List<Content> content1 =
		 * contentSerivce.tcreationtimeDescending((long)1); List<Content> content2 =
		 * contentSerivce.tcreationtimeDescending((long)2); List<Classification> fenlei
		 * = classificationserivce.queryAll();
		 * sce.getServletContext().setAttribute("neirong1", content1);
		 * sce.getServletContext().setAttribute("neirong2", content2);
		 * sce.getServletContext().setAttribute("toufnelei", fenlei);
		 */
		 
	}

}